package 线程池的使用;

import lombok.extern.slf4j.Slf4j;


import java.util.Map;


/**
 * 下载用户清单及上传
 *
 * @author ss
 * @version Id: MerchantBatchHelper.java, v 0.1
 */
@Slf4j
public class BatchActivityThreadHelper implements Runnable {
    private ActivityConfigBiz activityConfigBiz;

    private AddActivityInfoBO infoBO;

    private String traceLogId;

    public BatchActivityThreadHelper(ActivityConfigBiz activityConfigBiz,
									 AddActivityInfoBO infoBO, String traceLogId) {
        this.activityConfigBiz = activityConfigBiz;
        this.infoBO = infoBO;
        this.traceLogId = traceLogId;
    }

    @Override
    public void run() {
        Map<String, String> filePath;
        //日志ID
        /* MDC.put(BestpayMarker.TRACE_LOG_ID, traceLogId);*/

        try {
            /*if (PurposeChannelEnum.ACCURATE_MALL.getCode().equals(infoBO.getPurposeChannel()) ||
                    PurposeChannelEnum.MEMBER_MALL.getCode().equals(infoBO.getPurposeChannel()) ||
                    PurposeChannelEnum.BATCH_MALL.getCode().equals(infoBO.getPurposeChannel())) {
                // 查询列表
                List<MerchantManageConditionBO> userList = activityConfigBiz.queryWxUser(infoBO);
                // 上传本地
                String uploadFileName = activityConfigBiz.listToExcel(userList);
                // 上传fastdfs
                String uploadFilePath = activityConfigBiz.uploadFile(uploadFileName);
                // 文件信息
                filePath = ActivityBizConvert.convertFile(uploadFileName, uploadFilePath);
            } else {
                //set转StringBuffer
                StringBuffer buff = activityConfigBiz.queryPhone(infoBO);
                //生成文件并上传fastdfs
                filePath = activityConfigBiz.createfile(buff);
            }

            log.info("申请批充活动返回结果：{}", res);*/
        } catch (Exception e) {
            log.error("批充活动处理异常，异常信息为：{}", e);
        }
    }

}
